package www.way2inbox.settings;

import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.view.View;
import android.view.Window;
import android.widget.ImageView;
import android.widget.TextView;

import com.way2sms.way2inbox.R;
/**
 * 
 * @author Swetha Bejugam
 * 
 */
public class SettingsHeaderActivity extends PreferenceActivity {
	// TelephonyManager tlpnmgr;
	// ImageView imgCancel;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// try {

		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_settings);
		((TextView) findViewById(R.id.title)).setText("Settings");
		((ImageView) findViewById(R.id.search)).setVisibility(View.VISIBLE);
		// .setOnClickListener(new OnClickListener() {
		//
		// @Override
		// public void onClick(View v) {
		// finish();
		//
		// }
		// });
		// @SuppressWarnings("unused")
		// UncaughtExceptionHandler mDfltExceptionHandler = Thread
		// .getDefaultUncaughtExceptionHandler();
		// Thread.setDefaultUncaughtExceptionHandler(this);
		addPreferencesFromResource(R.xml.settings_headers);
	}
}/*
 * To get values from settings xml preference keys and send key to below method
 */
// getPrefKeyValues(ApplicationConstants.SettingsPreferenceKeys.GEN_PLAY_SENT_SOUND);
// /* set values to preference text */
// setValuetoPrefKey();
// /* To get values entered in edittext preferences */
// getEdittextPrefValues(ApplicationConstants.SettingsPreferenceKeys.GEN_SMS_COST);
//
// } catch (Exception e) {
// System.err.println(e);
// }
// }

// private String getEdittextPrefValues(String edtPrefKey) {
// Preference edit1 = findPreference(edtPrefKey);
//
// // System.out.println(">>>Editvalue>>"
// // + String.valueOf(((EditTextPreference) edit1).getText()
// // .toString()));
// return String
// .valueOf(((EditTextPreference) edit1).getText().toString());
// }
//
// private void setValuetoPrefKey() {
// /* set values to preference text */
// getPreferenceScreen().findPreference(
// ApplicationConstants.SettingsPreferenceKeys.GEN_ABOUT)
// .setSummary(android.os.Build.VERSION.RELEASE);
// tlpnmgr = (TelephonyManager) this
// .getSystemService(Context.TELEPHONY_SERVICE);
// getPreferenceScreen().findPreference(
// ApplicationConstants.SettingsPreferenceKeys.MMS_GROUPCHAT)
// .setSummary(
// ApplicationConstants.USE_MMS_GROUPCHAT_SUB
// + tlpnmgr.getLine1Number());
//
// }
//
// private boolean getPrefKeyValues(String key) {
// /* To get values from settings xml preference keys for booelans */
// SharedPreferences prefs = PreferenceManager
// .getDefaultSharedPreferences(getBaseContext());
// return prefs.getBoolean(key, false);
// }
//
// @SuppressWarnings("unused")
// private void alarm() {
// SharedPreferences getAlarms = PreferenceManager
// .getDefaultSharedPreferences(getBaseContext());
// String alarms = getAlarms.getString("SMS_RINGTONE", "default ringtone");
// Uri uri = Uri.parse(alarms);
// playSound(this, uri);
//
// // call mMediaPlayer.stop(); when you want the sound to stop
// }
//
// private MediaPlayer mMediaPlayer;
//
// private void playSound(Context context, Uri alert) {
// mMediaPlayer = new MediaPlayer();
// try {
// mMediaPlayer.setDataSource(context, alert);
// final AudioManager audioManager = (AudioManager) context
// .getSystemService(Context.AUDIO_SERVICE);
// if (audioManager.getStreamVolume(AudioManager.STREAM_ALARM) != 0) {
// mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
// mMediaPlayer.prepare();
// mMediaPlayer.start();
// }
// } catch (IOException e) {
// System.out.println("OOPS");
// }
// }
//
// @Override
// public void uncaughtException(Thread thread, Throwable ex) {
// System.err.println(ex);
// }
// //}
